for i in range(100):
    num1 = pow(i, 3)
    num2 = pow(i, 4)
    ls = []
    if 1000 <= num1 <= 9999:
        if 100000 <= num2 <= 999999:
            for item in str(num1) + str(num2):
                ls.append(int(item))
            if ((0 in ls) and (1 in ls) and (2 in ls) and (3 in ls) and (4 in ls) and
                    (5 in ls) and (6 in ls) and (7 in ls) and (8 in ls) and (9 in ls)):
                print(i)
